﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace Nirvana
{
    [CustomEditor(typeof(UIVariableBindActive))]
    public class UIVariableBindActiveEditor : UIVariableBindBoolEditor
    {
        private SerializedProperty transitionMode;
        private SerializedProperty transitionTime;
        protected override void OnEnable()
        {
            if (this.target == null) return;
            base.OnEnable();
            this.transitionMode = serializedObject.FindProperty("transitionMode");
            this.transitionTime = serializedObject.FindProperty("transitionTime");
        }

        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            this.serializedObject.Update();
            EditorGUILayout.PropertyField(this.transitionMode, new GUILayoutOption[0]);
            if (this.transitionMode.enumValueIndex == 1)
            {
                EditorGUILayout.PropertyField(this.transitionTime, new GUILayoutOption[0]);
            }

            base.serializedObject.ApplyModifiedProperties();



        }

    }
}

